<?php if (!defined('THINK_PATH')) exit();?><form id="pagerForm" action="/Admin/Address/index" method="post">
    <input type="hidden" name="pageNum" value="<?php echo ($page['pageNum']); ?>"/>
<input type="hidden" name="numPerPage" value="<?php echo ($page['numPerPage']); ?>" />
    <input type="hidden" name="pid" value="<?php echo ($search['pid']); ?>" />
    <input type="hidden" name="pidSort" value="<?php echo ($search['pidSort']); ?>" />
</form>

<script type="text/javascript" src="/Public/Admin/Js/twoLinkage.js"></script>
<script type="text/javascript">
$( function() {
	var parentObj = $('select[name="pidSort"]');
        var subObj = $('select[name="secondpid"]');
	$.twoLinkage( parentObj, subObj );
        
        var parentObj = $('select[name="secondpid"]');
        var subObj = $('select[name="pid"]');
	$.twoLinkage( parentObj, subObj );
} );
</script>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" action="/Admin/Address/expressAddr" method="post">
    <div class="searchBar">
        <ul class="searchContent">
			<li>用户名：<input type="text" name="username" value="<?php echo ($search['username']); ?>" /></li>
            <li>
                <label>类型：</label>
                <select name="type" class="required">
                    <option value="0">请选择</option>
                    <option value="1" <?php if(1 == $search['type']): ?>selected = "selected"<?php endif; ?> >寄出地址</option>
					<option value="2" <?php if(2 == $search['type']): ?>selected = "selected"<?php endif; ?> >送达地址</option>
					<option value="3" <?php if(3 == $search['type']): ?>selected = "selected"<?php endif; ?> >返货地址</option>
                </select>
			</li>
			<li>
                <label>默认地址：</label>			
                <select name="isdefault" class="required">
                    <option value="">请选择</option>
                    <option value="1" <?php if(1 == $search['isdefault']): ?>selected = "selected"<?php endif; ?> >否</option>
					<option value="2" <?php if(2 == $search['isdefault']): ?>selected = "selected"<?php endif; ?> >是</option>
                </select>
			</li>	
			<li>
                <label>常用地址：</label>	
				<select name="iscommon" class="required">
                    <option value="">请选择</option>
                    <option value="1" <?php if(1 == $search['iscommon']): ?>selected = "selected"<?php endif; ?> >否</option>
					<option value="2" <?php if(2 == $search['iscommon']): ?>selected = "selected"<?php endif; ?> >是</option>
                </select>
            </li>
        </ul>
        <div class="subBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
            </ul>
        </div>
    </div>
    </form>
</div>

<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li>
                <a href="/Admin/Address/add" class="add" rel="add" target="navTab"  title="添加"> <!--   -->
                    <span>添加</span>
                </a>
            </li>
            <li class="line">line</li>
            <li>
                <a href="/Admin/Address/edit/id/{sid_user}" rel="edit" class="edit" target="navTab" title="编辑">
                    <span>编辑</span>
                </a>
            </li>
            <li class="line">line</li>
            <li>
                <a class="delete" href="/Admin/Address/remove" target="selectedTodo" rel="id" posttype="string" title="你确定要批量删除吗？">
                    <span>删除</span>
                </a>
            </li>
			<li>
                <a class="audit" href="/Admin/Address/check" target="selectedTodo" rel="id" posttype="string" title="你确定要批量审核吗？">
                	<i class="iconfont">&#xe62c;</i>
                    <span>审核</span>
                </a>
            </li>
        </ul>
    </div>
    <table class="table" width="100%" layoutH="206">
        <thead>
        <tr>
            <th width="2%"><input type="checkbox" group="id" class="checkboxCtrl" ></th>
            <th width="3%">编号</th>
            <th width="10%">姓名</th>
            <th width="16%">详细地址</th>
            <th width="10%">联系方式</th>
			<th width="10%">地址类别</th>  
			<th width="10%">是否默认地址</th>
			<th width="10%">是否常用地址</th>
            <th width="10%">创建时间</th>
            <th width="5%">显示状态</th>
        </tr>
        </thead>
        <tbody>
        <?php if($dataList|count > 0): if(is_array($dataList)): $k = 0; $__LIST__ = $dataList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$volist): $mod = ($k % 2 );++$k;?><tr target="sid_user" rel="<?php echo ($volist['id']); ?>" >
                    <td><input name="id" value="<?php echo ($volist['id']); ?>" type="checkbox"></td>
                    <td><?php echo ( $page['pageNum'] - 1 ) * $page['numPerPage'] + $k;?></td>
                    <td><?php echo ($volist['username']); ?></td>
					<td><?php echo ($volist['address']); ?></td>
					<td><?php echo ($volist['phone']); ?></td>
					<td>
						<?php if($volist["type"] == 1): ?><span style="color:#00CDCD;" class="span_green" >寄出地址</span>
						<?php elseif($volist["type"] == 2): ?>
							<span style="color:#00CD00;" class="span_green" >送达地址</span>
						<?php else: ?>
							<span style="color:red;" class="span_green" >返货地址</span><?php endif; ?>
					</td>
					<td><?php if($volist["is_default"] == 1): ?><span style="color:#00FA9A;" class="span_green" >是</span><?php else: ?><span style="color:#F08080;" class="span_green" >否</span><?php endif; ?></td>
					<td><?php if($volist["is_common"] == 1): ?><span style="color:#00FA9A;" class="span_green" >是</span><?php else: ?><span style="color:#F08080;" class="span_green" >否</span><?php endif; ?></td>
                    <td><?php echo (date("Y-m-d H:i:s",$volist['addtime'])); ?></td>
                    <td>
                    	<?php if($volist['status'] == 1): ?><span style="color:red;" class="span_green" >前台未显示</span><?php endif; ?>
	                    <?php if($volist['status'] == 0): ?><span style="color:green;" class="span_green" >前台已显示</span><?php endif; ?>
                    </td>
                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        <?php else: ?>
        	<tr><td colspan="10" style="text-align:center;">没有数据!!!</td></tr><?php endif; ?>
        </tbody>
    </table>
    <div class="panelBar" style="background:none;">
    <div class="pages">
        <span>显示</span>
        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
            <?php if(is_array($page['numPerPageArray'])): foreach($page['numPerPageArray'] as $key=>$vo): ?><option value="<?php echo ($vo); ?>"<?php if($vo == $page['numPerPage']): ?>selected='selected'<?php endif; ?>><?php echo ($vo); ?></option><?php endforeach; endif; ?>
        </select>
        <span>条，共<?php echo ($page['all']); ?>条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="<?php echo ($page['all']); ?>" numPerPage="<?php echo ($page['numPerPage']); ?>" pageNumShown="10" currentPage="<?php echo ($page['pageNum']); ?>"></div>
</div>
</div>